<?php

require_once dirname( __FILE__ ) . '/config.php';

session_start();

if ( empty( $_SESSION['name'] ) && !empty( $_GET['name'] ) && trim( $_GET['name'] ) ) {
	$_SESSION['name'] = trim( $_GET['name'] );
}

header( 'Location: ' . CHAT_HOME . 'chat.php' . ( empty( $_COOKIE ) ? '?name=' . urlencode( trim( $_GET['name'] ) ) : '' ) );

?>